
import React,{ Component } from 'react';
import { TreeSelect } from 'antd';

const treeData = [{
  label: 'Node1',
  value: 'Node1',
  key: '0-0',
  disabled: true,
  children: [{
    label: 'Child Node1',
    value: '0-0-1',
    key: '0-0-1',
  }, {
    label: 'Child Node2',
    value: '0-0-2',
    key: '0-0-2',
  }],
}, {
  label: 'Node2',
  value: 'Node2',
  key: '0-1',
}];

class TestTreeSelect6 extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
        value: undefined,
    }
  }
  onChange = (value) => {
    console.log(arguments);
    this.setState({ value });
  }
  render() {
    return (
      <TreeSelect
        style={{ width: 300 }}
        value={this.state.value}
        dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}
        treeData={treeData}
        placeholder="Please select"
        treeDefaultExpandAll="true"
        multiple
        showSearch
        allowClear
        onChange={this.onChange}
      />
    );
  }
}

export default TestTreeSelect6;

